package com.milestone.fitnesspersonaltrainer.service;

import com.milestone.fitnesspersonaltrainer.constants.ConstantCode;
import com.milestone.fitnesspersonaltrainer.model.CategoryModel;
import com.milestone.fitnesspersonaltrainer.model.HomeModel;
import com.milestone.fitnesspersonaltrainer.network.response.BaseResponse;
import com.milestone.fitnesspersonaltrainer.network.response.RxVoid;

import java.util.ArrayList;

import io.reactivex.Flowable;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * Created by ThinkPad on 2017/11/2.
 */

public interface WallpaperService {

    @GET(ConstantCode.NAMESPACE + "/getGallery.php")
    Flowable<BaseResponse<ArrayList<HomeModel>>> getGalleryData();

    @GET(ConstantCode.NAMESPACE + "/getCategoryThumb.php")
    Flowable<BaseResponse<ArrayList<HomeModel>>> getHomeData(@Query("page") int pageIndex,
                                                             @Query("ca_pic_limit") int pageCount,
                                                             @Query("ca_limit") int categoryLimit);

    @GET(ConstantCode.NAMESPACE + "/getCategoryList.php")
    Flowable<BaseResponse<ArrayList<CategoryModel>>> getCategoryData();

    @GET(ConstantCode.NAMESPACE + "/getThbPageByCat.php")
    Flowable<BaseResponse<ArrayList<HomeModel>>> getPicturesByCategory(@Query("page") int pageIndex,
                                                                       @Query("limit") int pageCount,
                                                                       @Query("category") String category);

    @GET(ConstantCode.NAMESPACE + "/searchRandom.php")
    Flowable<BaseResponse<ArrayList<HomeModel>>> searchPicture(@Query("limit") int pageCount,
                                                               @Query("search") String keyWords);

    @GET(ConstantCode.NAMESPACE + "/addLikeByUrl.php")
    Flowable<BaseResponse<RxVoid>> addLike(@Query("url") String url);
}
